package com.spring.housing1.other;

import com.spring.housing1.returnType.CommenResult;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;



@ControllerAdvice(basePackages = "com.spring.housing1.controller.commen")
public class ErroeHandel {
    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public CommenResult exceptionHandler(Exception e){
   return  new CommenResult(500,e.getMessage(),"空");
    }


}
